package com.woniu.controller;

import com.woniu.entity.InpatientNursingRecord;
import com.woniu.service.INursingRecordService;
import com.woniu.utils.ResponseUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.text.ParseException;

@RestController
@RequestMapping("/nursing-record")
public class NursingRecordController {
    @Resource
    private INursingRecordService nursingRecordService;
    //传入病人id
    @GetMapping("/{caseId}")
    public ResponseUtil list(@PathVariable Integer caseId){
        ResponseUtil result = nursingRecordService.recordList(caseId);
        return result;
    }
    //添加护理记录
    @PostMapping
    public ResponseUtil addRecord(@RequestBody InpatientNursingRecord record) throws ParseException {
        ResponseUtil result = nursingRecordService.addRecord(record);
        return result;
    }
}
